<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="com.falidos.modelo.artefatos.Usuario" %>

<%session = request.getSession();
Usuario usuario = (Usuario) session.getAttribute("usuario");
if(!usuario.getCategoria().equals("Administrador")){
	   response.sendRedirect("/falidos.com/erro/erroAuth.jsp");
}
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>..::Falidos.com - Cadastro de Livros::..</title>
<link href="../css/estilos.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript"
	src="../scripts/jquery-1.7.2.js"></script>
<script language="javascript" type="text/javascript"
	src="../scripts/jquery.validate.js"></script>
<script language="javascript" type="text/javascript"
	src="../scripts/jquery.maskedinput-1.3.js"></script>
<script language="javascript" type="text/javascript"
	src="../scripts/formularioCadastro.js"></script>
<script language="javascript" type="text/javascript"
	src="../scripts/funcoes.js"></script>
</head>
<body>
	<div id="titulo">
		
	</div>
	<div id="principal">
		<div id="login"><jsp:include page="../login.jsp" flush="true" /></div>
		<div id="conteudo">
			<br>
			<h3 align="center">Cadastro de Livros</h3>
			<br>
			<form method="post" id="formCadastro" action="/falidos.com/Persistir">		
				<input type="hidden" id="sucesso" value="<%=request.getParameter("sucesso")%>" />		
				<input type="hidden" name="acao" value="cadastrar" />
				<table align="center">
					<tr>
						<td>Isbn:</td>
						<td><input type="text" id="isbn" name="isbn"></td>
						<td></td>
					</tr>
					<tr>
						<td>Titulo:</td>
						<td><input type="text" id="tit" name="tit"></td>
						<td></td>
					</tr>
					<tr>
						<td>Autor:</td>
						<td><input type="text" id="autor" name="autor"></td>
						<td></td>
					</tr>
					<tr>
						<td>Preco:</td>
						<td><input type="text" id="preco" name="preco"></td>
						<td></td>
					</tr>
					<tr>
						<td>Categoria:</td>
						<td><input type="text" id="categoria" name="categoria"></td>
						<td></td>
					</tr>
					<tr>
						<td>Palavras-Chave:</td>
						<td><textarea cols="16" rows="5" id="palavrachave" name="palavrachave"></textarea></td>
						<td></td>
					</tr>									
				</table>
				<table align="center">
					<tr>
						<td colspan="2" align="center"><br> <br> <button
							type="submit" id="botSubmit" name="botSubmit" value="Livro">Cadastrar</button>&nbsp;&nbsp;
							<a href="/falidos.com/index.jsp"><input type="button" id="botVoltar"
								name="botVoltar" value="Voltar"></a></td>
					</tr>
				</table>
			</form>		
		</div>
		<br style="clear: both" />
	</div>
</body>
</html>